////////////////////////////////////////////////////////////////////////////////
//  COPYRIGHT (C) 2010 TELECOM DIGITAL MEDIA ("TDMEDIA").
//  ALL RIGHTS RESERVED.
//
//  THIS IS CONFIDENTIAL AND PROPRIETARY INTELLECTUAL PROPERTY OWNED BY AND
//  CREATED ON BEHALF OF TDMEDIA. ANY FORM OF DISTRIBUTION, COPY,
//  MODIFICATION WITHOUT THE WRITTEN CONSENT FROM TDMEDIA IS STRICTLY
//  PROHIBITED.
////////////////////////////////////////////////////////////////////////////////

package cc.telecomdigital.tdstock;

public interface CommonDefn
{
//	public enum Environment
//	{
//		Testing, Production
//	};

	public enum DataMode
	{
		Realtime, Delay
	};

	/**
	 * 登入模式
	 * DELARY		无登入	 延迟模式,
	 * ACTIVECODE	验证码登录 试用模式,
	 * ACCOUNTLOGIN	用户名密码 登录模式,
	 * @author ouyangzhihui
	 *
	 */
	public enum ModeType
	{
		DELARY, ACTIVECODE, ACCOUNTLOGIN
	}

	// Current Setting
	public static final String	SYSTEM_CURRENT_SETTING					= "system_current_setting";
	public static final String BOOKMARK_NUMBER                                = " bookmark_number";
	public static final String	PREFERENCE_STOCK_CODE					= "preference_stock_code";
	public static final String	PREFERENCE_DEVICE_ID					= "preference_device_id";
	public static final String	PREFERENCE_IS_SEND_ACTIVE_CODE			= "preference_is_send_active_code";
	public static final String	PREFERENCE_TRIAL_ACTIVE_CODE				= "preference_trial_active_code";
	public static final String	PREFERENCE_IS_AUTO_LOGIN_APP				= "preference_is_auto_login_app";
	public static final String	PREFERENCE_IS_FIRST_LOGON_APP	 			= "preference_is_first_logon_app";
	//	public static final String		PREFERENCE_LAST_LOGON_TYPE	=	"preference_last_logon_type";
	public static final String	PREFERENCE_LAST_ACCOUNT_NAME				= "preference_last_account_name";
	public static final String	PREFERENCE_LAST_ACCOUNT_PWD				= "preference_last_account_pwd";
	public static final String	PREFERENCE_AUTO_LOGIN_FAIL_COUNTER			= "preference_auto_login_failure_counter";
	public static final String	PREFERENCE_PRESENT_AD_ID					= "preference_present_ad_id";
	
	public static final String	PREFERENCE_NOTIFICATION_SHOW_TYPE_ID					= "preference_notification_show_type";
	public static final String	PREFERENCE_NOTIFICATION_RINGTONG				= "preference_notification_ringtong";
	

//	public static final String	HTTP_PROTOCOL							= "http://";
//	public static final String	HOST_PORT_SEPARATOR						= ":";

	//Bundle Info 
	public static final String	APPLICATION_CONTEXT_KEY_USERID			= "app_context_user_id";
	public static final String	APPLICATION_CONTEXT_KEY_PASSWORD			= "app_context_user_pwd";
	public static final String	APPLICATION_CONTEXT_KEY_ACCOUNT			= "app_context_user_account";
	public static final String	APPLICATION_CONTEXT_KEY_TOKEN				= "app_context_user_token";
	public static final String	APPLICATION_CONTEXT_ACTIVITY_TITLE			= "app_context_activity_title";

	public static final String	ACCOUNT_USER_NAME_TRIAL_DELAY				= "tdldemo";
	public static final String	ACCOUNT_USER_PWD_TRIAL_DELAY				= "tdldemopasswd";
	public static final String	ACCOUNT_USER_DELAY_ACCOUNT				= "tdldemoaccounthk";
	public static final String	ACCOUNT_USER_DELAY_TOKEN				= "tdldemotoken";
	
	

	//	public static final String      LOGIN_BY_ACTIVATION_CODE = "by.activation.code";
	//	public static final String      LOGIN_BY_ACCOUNT = "by.user.pwd";
	//	public static final String      LOGIN_BY_USING_DELAY_MODE = "using.delay.mode";

   // public static final String   SYSTEM_SESSION_ACCOUNT="sessionAccount";

//	public static final String	WEB_SERVER_HOST_0						= "quotedev2.telecomdigital.cc";
////	public static final String	WEB_SERVER_HOST_0						= "quotedev3.telecomdigital.cc";			// //203.82.254.53; NOTES: it's Testing Environment--Real-time Mode
	public static final String	SYSTEM_TRIAL_ACCOUNT_USER				= "";				//test93			//web02//internet
	public static final String	SYSTEM_TRIAL_ACCOUNT_PWD					= "";			//2468				//9804//9959
//	public static final String	LIGHT_STREAMER_HOST_0					= "pushdev3.telecomdigital.cc";			//NOTES: it's Testing Environment--Real-time Mode //pushdev3.telecomdigital.cc
//	public static final int		LIGHT_STREAMER_PORT_0					= 80;								//8080  NOTES: it's Testing Environment--Real-time Mode
//
//	public static final String	WEB_SERVER_HOST_1						= "quotefreedev2.telecomdigital.cc";		//NOTES: it's Testing Environment--Delay Mode
//	public static final String	LIGHT_STREAMER_HOST_1					= "pushfreedev2.telecomdigital.cc";		//NOTES: it's Testing Environment--Delay Mode
//	public static final int		LIGHT_STREAMER_PORT_1					= 80;								//8080  NOTES: it's Testing Environment--Delay Mode
//
//	public static final String	WEB_SERVER_HOST_PRODUCTION_0				= "quotea.telecomdigital.cc";			//  quotei.telecomdigital.cc NOTES: it's Production Environment --Real-time Mode
//	public static final String	LIGHT_STREAMER_HOST_PRODUCTION_0			= "pusha.telecomdigital.cc";				//pushi.telecomdigital.cc NOTES: it's Production Environment--Real-time Mode
//	public static final int		LIGHT_STREAMER_PORT_PRODUCTION_0			= 80;								//8080  NOTES: it's Production Environment --Real-time Mode
//
//	public static final String	WEB_SERVER_HOST_PRODUCTION_1				= "quotefreea.telecomdigital.cc";			//quotefree.telecomdigital.cc NOTES: it's Production Environment --Delay Mode
//	public static final String	LIGHT_STREAMER_HOST_PRODUCTION_1			= "pushfreea.telecomdigital.cc";			//pushfree.telecomdigital.cc pushfree.telecomdigital.cc  NOTES: it's Production Environment --Delay Mode
//	public static final int		LIGHT_STREAMER_PORT_PRODUCTION_1			= 80;								//8080  NOTES: it's Production Environment--Delay Mode
//	
//	
//	
//	public static final String  URL_DEVELOPMENT_AD = "http://quotedev2.telecomdigital.cc/iphone/androidad/";
//	public static final String  URL_PRODUCTION_AD = "http://quotefreea.telecomdigital.cc/iphone/androidad/";
//
//	public static final String	ADAPTER_SET_FOR_FREE					= "FREETELETEXT";
//	public static final String	ADAPTER_SET_FOR_CHARGE					= "TELETEXT";
//
//	public static final int		DEVICE_TYPE							= 2;
//	//public static final String	VERSION								= "1.2.2";
//	public static final int		INVALID_RESOURCE_ID						= -999;

	//web dev: quotedev2.telecomdigital.cc:80
	//Lightstreamer dev: pushdev2.telecomdigital.cc:80

	

	public static final String	DEFAULT_FIELD_VALUE						= "--";

	// DT, 2011/01/14, added as iPhone app shows "---" for some data items
	public static final String	DEFAULT_FIELD_VALUE2					= "---";

	public static final String	UNIT_M								= "M";
	public static final String	UNIT_K								= "K";
	public static final String	UNIT_B								= "B";

	public static final float	CHART_CIRCLE_R							= 60.0f;
	public static final int		CHART_CIRCLE_TEXT_SIZE					= 12;

	public static final double	APPROACH_ZERO							= 0.000001d;

	public static final String	ACCOUNT_USER_ID_KEY						= "account.userid";
	public static final String	ACCOUNT_USER_KEY						= "account.user";
	public static final String	ACCOUNT_PWD_KEY						= "account.pwd";

	public static final String	DEVICE_ID								= "device.id";

	public static final String	ACTIVITY_CAME_FROM_KEY					= "activity.camefrom";
	public static final String	DATASOURCE_URL							= "datasource.url";
	public static final String	TOP_BAR_TITLE							= "top.bar.title";

	public static final String	CURRENT_STOCK_INFO_CODE					= "current.stock.code";
	public static final String	CURRENT_STOCK_INFO_NAME					= "current.stock.name";
	public static final String	CURRENT_NAVIGATION_BTN_RES_ID				= "current.navigation.btn.res.id";
	public static final String	CURRENT_SESSION_ACCOUNT					= "current.session.account";
	public static final String	CURRENT_SESSION_TOKEN					= "current.session.token";

	public static final String	STOCK_DIARY_EDITING_ITEMCODE				= "diary.editing.itemcode";
	public static final String	STOCK_DIARY_EDITING_ITEMNAME				= "diary.editing.itemname";
	public static final String	STOCK_DIARY_EDITING_CURRENT_PRICE			= "diary.editing.current.price";
	public static final String	STOCK_DIARY_EDITING_CURRENT_RECNO			= "diary.editing.current.recno";
	public static final String	STOCK_DIARY_EDITING_DATE					= "diary.editing.date";
	public static final String	STOCK_DIARY_EDITING_OFSHARES				= "diary.editing.ofshare";
	public static final String	STOCK_DIARY_EDITING_DIARY_PRICE			= "diary.editing.diary.price";
	public static final String	STOCK_DIARY_EDITING_MEMO					= "diary.editing.memo";

	public static final String	CUSTOMER_PREFER_RSI_TERM					= "customer.prefer.rsi.term";
	public static final String	DB_CHART_PREFER_RSITERM_CATALOGUE			= "chart.prefer.rsiterm";

	public static final String	FROM_MONITOR_TO_ACTIVITY_FORWARDING_ITEM	= "from.monitor.to.activity.itemcode";
	public static final String	FROM_MONITOR_TO_ACTIVITY_FORWARDING_ADAPTER	= "from.monitor.to.activity.adapter";

	public static final int		CONNECTION_TIMEOUT						= 4500;								//4.5 seconds; //it must less than the ANR  waiting time( 5 seconds);

	public static int			HIGHLIGHT_BACKGROUND_COLOR				= 0xffffb554;
	public static int			HIGHLIGHT_BACKGROUND_COLOR_INDEX			= 0xff0033ff;
	public static int			FOREST_GREEN							= 0xff00fa00;

	public static int			MONITOR_HIGHLIGHT_BACKGROUND_ORANGE		= 0xffff8000;
	public static int			MONITOR_HIGHLIGHT_BACKGROUND_GREEN			= 0xa81aff53;

	public static int			CHART_LINE_ABOVE_COLOR					= 0xff0f2255;
	public static int			CHART_LINE_BELOW_COLOR					= 0xff13338f;

	public static String		SECTOR_REG							= "sector=[0-9]{1,}";
	public static String		STOCK_LIST_TOP20_REG					= "STOCKLIST_*.*";						//please don't modify it.

	public static String		RECEIVER_ITEM_CODE_CHANGE				= "quotedev.mango.cc.current.stock.code";
	public static String		RECEIVER_SESSION_EXPIRED					= "quotedev.mango.cc.session.expired";
	public static String		RECEIVER_WILL_EXIT_APP				= "quotedev.mango.cc.exit.app";

	public static String		ANOTHER_INSTANCE						= " :instance 2";
    public static final int DEALRY_MAX_BOOKMARK_NUMBER=15;
    
	//public final static String	TDSTOCK_VERSION						= "2.0.3";							//need to update by manual every time after uploading the apk file to ftp server

	public class DoThingsReturn
	{
		public Object	cmd;
		public Object	data;
		public int	errCode;

		public DoThingsReturn(Object cmd, Object data, int errorCode)
		{
			super();
			this.cmd = cmd;
			this.data = data;
			this.errCode = errorCode;
		}
	}

	//by zhengan
	public static final String	PREFERENCE_HORSERACE_PHONE_BETTING_NUMBER	= "preference_horserace_phone_betting_number";
	public static final String	PREFERENCE_SOCCER_PHONE_BETTING_NUMBER		= "preference_soccer_phone_betting_number";
	public static final String	PREFERENCE_HORSERACE_PHONE_BETTING_INDEX	= "preference_horserace_phone_betting_index";
	public static final String	PREFERENCE_SOCCER_PHONE_BETTING_INDEX		= "preference_soccer_phone_betting_index";
	
	public enum  BookMarkType{
	stock(1), 
	index(2), 
	futures(3), 
	worldindex(4), 
	worldfutures(5), 
	fx(6), 
	metal(7), 
	oil(8), 
	cop(9);
	private int value;
	BookMarkType(int num){
		this.value=num;
	}
	public int getBookMarkType(){
		return value;
	}
	};
}
